<template>
    <m-page-wrapper>
        <m-crud ref="crudRef" :option="option">
        </m-crud>
    </m-page-wrapper>
</template>
<script setup lang="ts">
import { h, ref } from 'vue'
import { CrudType } from '/@/components/Crud/types';
import { Button, message } from 'ant-design-vue';
const crudRef = ref()
const option = ref<CrudType>({
    formProps: {
    labelWidth: '100px',
    // labelCol: { flex: '100px' },
  },

    // 标题
    title: '设备管理',
      // 列表接口
    api: 'EdgeGateways/GetEdgeDeviceList',
    columns: [
    {
      title: '序号',
      dataIndex: 'edgeGatewayId',
      key: 'edgeGatewayId',
      list: true,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入边缘设备ID', trigger: 'blur' }]
    },
    {
      title: '设备名称',
      dataIndex: 'name',
      key: 'name',
      search: true,
      searchType: "EQ",
      list: true,
      view: true,
      add: true,
      edit: true,
      component: 'Input',
      componentProps: {
      },
      rules: [{ required: false, message: '请输入设备名称', trigger: 'blur' }]
    },
    {
      title: '所属边缘设备',
      dataIndex: 'hardwareType',
      key: 'hardwareType',
      list: true,
      view: true,
      add: true,
      edit: true,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
    },
    {
      title: '所属宿主设备',
      dataIndex: 'deviceTpye',
      key: 'deviceTpye',
      list: true,
      view: true,
      add: true,
      edit: true,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
    },
    {
      title: '所属组织',
      dataIndex: 'organizational',
      key: 'organizational',
      list: true,
      view: true,
      add: true,
      edit: true,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
    },
    {
      title: '网关',
      dataIndex: 'edgeAuth',
      key: 'edgeAuth',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
    },
    {
      title: '用户',
      dataIndex: 'heaters',
      key: 'heaters',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
        maxlength: 20,
      },
      rules: [{ required: false, message: '请输入列表设备ID', trigger: 'blur' }]
    },
    {
      title: '通讯状态',
      dataIndex: 'currState',
      key: 'currState',
      list: true,
      view: true,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
      },
      rules: [{ required: false, message: '请输入应用编码', trigger: 'blur' }]
    },

    {
      title: '描述',
      dataIndex: 'description',
      key: 'description',
      list: false,
      view: true,
      add: true,
      edit: true,
      component: 'Input',
      componentProps: {
      },
      rules: [{ required: false, message: '请输入备注', trigger: 'blur' }]
    },
    {
      title: '创建时间',
      dataIndex: 'registerTime',
      key: 'registerTime',
      list: true,
      view: false,
      add: false,
      edit: false,
      component: 'DatePicker',
      componentProps: {
        valueFormat: "YYYY-MM-DD",
        mode: "date",
        format: "YYYY-MM-DD",
      },
      rules: [{ required: false, message: '请输入创建时间', trigger: 'blur' }]
    },
    {
      title: '创建用户',
      dataIndex: 'createUser',
      key: 'createUser',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
      },
      rules: [{ required: false, message: '请输入创建用户', trigger: 'blur' }]
    },
    {
      title: '更新时间',
      dataIndex: 'updateTime',
      key: 'updateTime',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'DatePicker',
      componentProps: {
        valueFormat: "YYYY-MM-DD",
        mode: "date",
        format: "YYYY-MM-DD",
      },
      rules: [{ required: false, message: '请输入更新时间', trigger: 'blur' }]
    },
    {
      title: '更新用户',
      dataIndex: 'updateUser',
      key: 'updateUser',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
      },
      rules: [{ required: false, message: '请输入更新用户', trigger: 'blur' }]
    },
    {
      title: '是否删除',
      dataIndex: 'isDeleted',
      key: 'isDeleted',
      list: false,
      view: false,
      add: false,
      edit: false,
      component: 'Input',
      componentProps: {
        type: "text",
      },
      rules: [{ required: false, message: '请输入是否删除', trigger: 'blur' }]
    },]
  
 
})
</script>
<style lang="less" scoped></style>